﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcShop.Models.ChangePasswordModel>" %>

<asp:Content ID="changePasswordTitle" ContentPlaceHolderID="TitleContent" runat="server">
    <%=ViewData["Page_Title"] %>
</asp:Content>

<asp:Content ID="changePasswordContent" ContentPlaceHolderID="MainContent" runat="server">
    <div id="Content-rigth">
       <div class="user-navigate"><a href="<%=Url.ToHome() %>">首页</a>  >  <a href="<%=Url.Action("Index","UsersHome") %>">我的账户</a> > 密码修改<hr/></div>
       <div class="user-content"> 
		     <div class="module-container">
			    <div class="title">密码修改</div>
			    <div class="module-content">
                    <p>
                        新密码长度必须是 6-10 位。
                    </p>
                    <%= Html.ValidationSummary("密码修改不成功，请重新试一次。") %>

                    <% using (Html.BeginForm("ChangePassword", "UsersAccount", FormMethod.Post, new { id = "cPForm" }))
                       { %>
                        <div>
                            <fieldset>
                                <legend>详细字段</legend>
                                <p>
                                    <%= Html.LabelFor(m => m.OldPassword)%> <em class="red">*</em><br />
                                    <%= Html.Password("OldPassword")%>
                                    <%= Html.ValidationMessageFor(m => m.OldPassword)%>
                                </p>
                                <p>
                                    <%= Html.LabelFor(m => m.NewPassword)%> <em class="red">*</em><br />
                                    <%= Html.Password("NewPassword")%>
                                    <%= Html.ValidationMessageFor(m => m.NewPassword)%>
                                </p>
                                <p>
                                    <%= Html.LabelFor(m => m.ConfirmPassword)%> <em class="red">*</em><br />
                                    <%= Html.Password("ConfirmPassword")%>
                                    <%= Html.ValidationMessageFor(m => m.ConfirmPassword)%>
                                </p>
                                <p>
                                    <input type="submit" value="修改" />
                                </p>
                                <p>
                                    <input type="hidden" name="<%= ViewData["key"]%>" id="<%= ViewData["key"]%>" value="<%= ViewData["value"]%>" />
                                </p>
                            </fieldset>
                        </div>
                    <% } %>
                    <script language="javascript" type="text/javascript">
                        $("#cPForm").validate({
                            rules: {
                                "OldPassword": { required: true, rangelength: [6, 10] },
                                "NewPassword": { required: true, rangelength: [6, 10] },
                                "ConfirmPassword": { required: true, rangelength: [6, 10], equalTo: "#NewPassword" }
                            },
                            messages: {
                                "OldPassword": { required: "请输入用户名。", rangelength: "密码长度介于 6 和 10 之间的字符串。" },
                                "NewPassword": { required: "请输入密码。", rangelength: "密码长度介于 6 和 10 之间的字符串。" },
                                "ConfirmPassword": { required: "请输入验证码。", rangelength: "密码长度介于 6 和 10 之间的字符串。", equalTo: "密码与确认密码不相同。" }
                            },
                            onkeyup: false
                        });
                   </script>
			    </div>
			 </div>
			 <%=Html.Partial("HelpDiv") %>
		</div>
    </div>
    <div id="Sidebar">
       <%=Html.Partial("UserNavigation") %>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadLink" runat="server">
   <link href="<%=Url.Resources("cssUsers") %>" rel="Stylesheet" type="text/css" />
   <script language="javascript" type="text/javascript" src="<%=Url.Resources("jqmvf") %>"></script>
   <style type="text/css">
       form lable.err
       { 
       	 margin-left:20px;
       }
    </style>
</asp:Content>
